﻿@model IEnumerable<WarOfDev.Web.ViewModels.TaskViewModel >
@using WarOfDev.Core.Common

@{
    ViewBag.Title = "Index";
}

<h2>All Tasks</h2>

<p>
    @Html.ActionLink("Create New", "Create")
    @Html.ActionLink("My Tasks", "My")
</p>


     
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ExperienceValue)
        </th>
        <th>
            @Html.DisplayNameFor(modelItem => modelItem.DeveloperName)
        </th>
        <th>
            @Html.DisplayNameFor(modelItem => modelItem.Status)
        </th>
        <th></th>
    </tr>


@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ExperienceValue)
        </td>
        <td>
          @Html.DisplayFor(modelItem => item.DeveloperName)
        </td>
       <td>
              @((EnumTaskStatus)item.Status)
        </td>
        <td>
            
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |

            @if(item.Status!= (int)EnumTaskStatus.Closed){
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }) 
            }
                                                                                                                              

        </td>
    </tr>
}

</table>
